<form id="<?php echo $uniqid;?>" method="post" style="padding: 0 8px 8px 0;">
    <table border="0" width="100%" cellspacing="1" cellpadding="5" class="formtable">
        <tr bgcolor="#FFFFFF">
            <td colspan="4">企业信息</td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel" width="10%">公司名称：</td>
            <td><input type="text" style="width: 300px;" readonly
                       class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                       placeholder="请输入公司名称.." required="true" v-model="params.name"></td>
            <td class="tlabel" width="10%">所属行业：</td>
            <td>
                <select v-model="params.industry_id" class="swidth forminput inputstyle" style="width: 140px">
                    <option v-for="(vo,index) in industry" :value="vo.id">{{vo.name}}</option>
                </select>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel">省市：</td>
            <td>
                <select v-model="params.province_id" class="swidth forminput inputstyle">
                    <option v-for="(vo,index) in city" v-if="vo.up==0" :value="vo.id">{{vo.name}}</option>
                </select>
                <select v-model="params.city_id" class="swidth forminput inputstyle">
                    <option v-for="(vo,index) in city" v-if="vo.up==params.province_id" :value="vo.id">{{vo.name}}</option>
                </select>
            </td>
            <td class="tlabel">地址：</td>
            <td><input type="text"
                       class="forminput inputstyle validatebox-text easyui-validatebox"
                       placeholder="请输入地址.." v-model="params.info.address"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="10%" class="tlabel">主营产品：</td>
            <td width="40%"><input type="text" style="width: 400px;"
                                   class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入主营产品.." v-model="params.info.main_products">
            </td>
            <td width="10%" class="tlabel" width="10%">标签：</td>
            <td width="40%"><input type="text" style="width: 400px;"
                                   class="forminput inputstyle validatebox-text textbox-prompt"
                                   placeholder="请输入主营行业.." v-model="params.info.label"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel">企业编码</td><td>
            <input type="text"
                   class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                   placeholder="请输入企业编码.." v-model="params.code">
        </td>
            <td class="tlabel">企业状态：</td>
            <td>
                <label><input name="status" type="checkbox" class="textbox-prompt" v-model="params.status">显示</label></td>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel">公司简介：</td>
            <td style="padding-top: 5px;"><textarea style="width: 545px;height: 40px;padding:8px;" v-model="params.info.instroduce"
                                                                class="formarea validatebox-text textbox-prompt easyui-validatebox"
                                                                placeholder="请输入公司简介.."></textarea></td>
            <td class="tlabel">公司Logo：</td>
            <td style="padding-left: 0;">
                <div title="上传图片">
                    <div class="col-md-12">
                        <div id="container" style="background-color:#F9F9F4">
                            <a class="btn btn-default btn-lg" id="companylogoPickfile<?php echo $uniqid;?>" href="#" style="text-decoration: none;">
                                <div style="padding:20px;"><i class="iconfont icon-xiangji"></i> 点击上传图片...</div>
                            </a>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <table id="uploadtable" class="formtable" id="fsUploadProgressTable1">
                            <tbody id="fsUploadProgress">
                            <template v-if="params.logo">
                                <tr class="progressContainer" style="opacity: 1;">
                                    <td class="progressName">
                                        <a data-lightbox='companyedit' :href="params.logo" title="查看原图">
                                            <img style="width: 80px" :src="params.logo+'?imageView2/1/w/100/h/100'">
                                        </a>
                                    </td>
                                    <td>
                                        <div class="info" style="display: flex">
                                            <div style="flex: 4"><span>{{params.logo}}</span></div>
                                            <div style="flex: 1">
                                                <input class='l-btn l-btn-small btn-del' @click="rm(1)" value="删除图片" type="button">
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </template>
                            </tbody>
                        </table>
                    </div>
                </div>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td colspan="4">扩展信息</td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="10%" class="tlabel">企业全称：</td>
            <td width="40%"><input type="text"
                                   class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入企业全称.." v-model="params.info.full_name">
            </td>
            <td width="10%" class="tlabel" width="10%">公司固话：</td>
            <td width="40%"><input type="text" class="forminput inputstyle validatebox-text textbox-prompt"
                                   placeholder="请输入公司固话.." v-model="params.info.tel"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="10%" class="tlabel">运营模式：</td>
            <td width="40%">
                <select v-model="params.info.operation_mode" class="swidth forminput inputstyle">
                    <option value="生产加工">生产加工</option>
                    <option value="经销批发">经销批发</option>
                    <option value="招商代理">招商代理</option>
                    <option value="商业服务">商业服务</option>
                    <option value="其他">其他</option>
                </select>
            </td>
            <td width="10%" class="tlabel" width="10%">企业类型：</td>
            <td width="40%">
                <select v-model="params.info.business_type" class="swidth forminput inputstyle">
                    <option value="国企">国企</option>
                    <option value="民营公司">民营公司</option>
                    <option value="事业单位">事业单位</option>
                    <option value="所有外资(欧美)">所有外资(欧美)</option>
                    <option value="外资(非欧美)">外资(非欧美)</option>
                    <option value="合资(欧美)">合资(欧美)</option>
                    <option value="合资(非欧美)">合资(非欧美)</option>
                    <option value="外企代表处">外企代表处</option>
                    <option value="其它性质">其它性质</option>
                </select>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="10%" class="tlabel">注册资金：</td>
            <td width="40%"><input type="text"
                                   class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入注册资金.." v-model="params.info.register_capital">
            </td>
            <td width="10%" class="tlabel" width="10%">主营品牌：</td>
            <td width="40%"><input type="text" style="width: 400px"
                                   class="forminput inputstyle validatebox-text textbox-prompt"
                                   placeholder="请输入主营品牌.." v-model="params.info.main_brands"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="10%" class="tlabel" width="10%">营业执照号码：</td>
            <td width="40%"><input type="text" class="forminput inputstyle validatebox-text textbox-prompt"
                                   placeholder="请输入主营品牌.." v-model="params.info.licence"></td>
            <td class="tlabel">营业执照图片：</td>
            <td style="padding-left: 0;">
                <div title="上传图片">
                    <div class="col-md-12">
                        <div style="background-color:#F9F9F4">
                            <a class="btn btn-default btn-lg" id="licenceimgPickfile<?php echo $uniqid;?>" href="#" style="text-decoration: none;">
                                <div style="padding:20px;"><i class="iconfont icon-xiangji"></i> 点击上传图片...</div>
                            </a>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <table class="formtable">
                            <tbody>
                            <template v-if="params.info.licence_img">
                                <tr class="progressContainer" style="opacity: 1;">
                                    <td class="progressName">
                                        <a data-lightbox='companyedit' :href="params.info.licence_img" title="查看原图">
                                            <img style="width: 80px" :src="params.info.licence_img+'?imageView2/1/w/100/h/100'">
                                        </a>
                                    </td>
                                    <td>
                                        <div class="info" style="display: flex">
                                            <div style="flex: 4"><span>{{params.info.licence_img}}</span></div>
                                            <div style="flex: 1">
                                                <input class='l-btn l-btn-small btn-del' @click="rm(4)" value="删除图片" type="button">
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </template>
                            </tbody>
                        </table>
                    </div>
                </div>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel">website</td><td>
            <input type="text" style="width: 400px"
                   class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                   placeholder="请输入公司网站.." v-model="params.info.website">
        </td>
            <td class="tlabel">Banner图：</td>
            <td style="padding-left: 0;">
                <div title="上传图片">
                    <div class="col-md-12">
                        <div id="swiper" style="background-color:#F9F9F4">
                            <a class="btn btn-default btn-lg" id="companybannerPickfile<?php echo $uniqid;?>" href="#" style="text-decoration: none;">
                                <div style="padding:20px;"><i class="iconfont icon-xiangji"></i> 点击上传图片...</div>
                            </a>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <table class="formtable">
                            <tbody>
                            <template v-if="params.info.banner">
                                <tr class="progressContainer" style="opacity: 1;">
                                    <td class="progressName">
                                        <a data-lightbox='companyedit' :href="params.info.banner" title="查看原图">
                                            <img style="width: 80px" :src="params.info.banner+'?imageView2/1/w/100/h/100'">
                                        </a>
                                    </td>
                                    <td>
                                        <div class="info" style="display: flex">
                                            <div style="flex: 4"><span>{{params.info.banner}}</span></div>
                                            <div style="flex: 1">
                                                <input class='l-btn l-btn-small btn-del' @click="rm(5)" value="删除图片" type="button">
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </template>
                            </tbody>
                        </table>
                    </div>
                </div>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel">备注：</td>
            <td colspan="3" style="padding-top: 5px;"><textarea style="width: 545px;height: 40px;padding:8px;" v-model="params.info.remark"
                                                                class="formarea validatebox-text textbox-prompt easyui-validatebox"
                                                                placeholder="请输入备注.."></textarea></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td colspan="4">联系人信息</td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="10%" class="tlabel">联系人：</td>
            <td width="40%"><input type="text" style="width: 100px;"
                                   class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入姓名.." v-model="params.members_info.contact">
            </td>
            <td width="10%" class="tlabel" width="10%">手机号：</td>
            <td width="40%"><input type="text" class="forminput inputstyle validatebox-text textbox-prompt"
                                   placeholder="联系手机号.." v-model="params.members.phone"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="10%" class="tlabel">QQ：</td>
            <td width="40%"><input type="text" style="width: 100px;"
                                   class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入QQ.." v-model="params.members_info.qq">
            </td>
            <td width="10%" class="tlabel" width="10%">邮箱：</td>
            <td width="40%"><input type="text" class="forminput inputstyle validatebox-text textbox-prompt"
                                   placeholder="请输入邮箱.." v-model="params.members_info.email"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="10%" class="tlabel">联系人真实姓名：</td>
            <td width="40%"><input type="text" style="width: 100px;"
                                   class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入真实姓名.." v-model="params.members_info.realname">
                <label><input type="radio" name="gender" v-model="params.members_info.gender" value="1">先生</label>
                <label><input type="radio" name="gender" v-model="params.members_info.gender" value="0">女士</label>
            </td>
            <td width="10%" class="tlabel" width="10%">身份证号：</td>
            <td width="40%"><input type="text" class="forminput inputstyle validatebox-text textbox-prompt"
                                   placeholder="身份证号.." v-model="params.members_info.idcard"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel">身份证正面照片：</td>
            <td style="padding-left: 0;">
                <div title="上传图片">
                    <div class="col-md-12">
                        <div id="shenfenzheng1" style="background-color:#F9F9F4">
                            <a class="btn btn-default btn-lg" id="shenfenzheng1Pickfile<?php echo $uniqid;?>" href="#" style="text-decoration: none;">
                                <div style="padding:20px;"><i class="iconfont icon-xiangji"></i> 点击上传图片...</div>
                            </a>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <table class="formtable">
                            <tbody>
                            <template v-if="params.members_info.idcard_img1">
                                <tr class="progressContainer" style="opacity: 1;">
                                    <td class="progressName">
                                        <a  data-lightbox='companyedit' :href="params.members_info.idcard_img1" title="查看原图">
                                            <img style="width: 80px" :src="params.members_info.idcard_img1+'?imageView2/1/w/100/h/100'">
                                        </a>
                                    </td>
                                    <td>
                                        <div class="info" style="display: flex">
                                            <div style="flex: 4"><span>{{params.members_info.idcard_img1}}</span></div>
                                            <div style="flex: 1">
                                                <input class='l-btn l-btn-small btn-del' @click="rm(2)" value="删除图片" type="button">
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </template>
                            </tbody>
                        </table>
                    </div>
                </div>
            </td>
            <td class="tlabel">身份证反面照片：</td>
            <td style="padding-left: 0;">
                <div title="上传图片">
                    <div class="col-md-12">
                        <div id="shenfenzheng2" style="background-color:#F9F9F4">
                            <a class="btn btn-default btn-lg" id="shenfenzheng2Pickfile<?php echo $uniqid;?>" href="#" style="text-decoration: none;">
                                <div style="padding:20px;"><i class="iconfont icon-xiangji"></i> 点击上传图片...</div>
                            </a>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <table class="formtable">
                            <tbody>
                            <template v-if="params.members_info.idcard_img2">
                                <tr class="progressContainer" style="opacity: 1;">
                                    <td class="progressName">
                                        <a data-lightbox='companyedit' :href="params.members_info.idcard_img2" title="查看原图">
                                            <img style="width: 80px" :src="params.members_info.idcard_img2+'?imageView2/1/w/100/h/100'">
                                        </a>
                                    </td>
                                    <td>
                                        <div class="info" style="display: flex">
                                            <div style="flex: 4"><span>{{params.members_info.idcard_img2}}</span></div>
                                            <div style="flex: 1">
                                                <input class='l-btn l-btn-small btn-del' @click="rm(3)" value="删除图片" type="button">
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </template>
                            </tbody>
                        </table>
                    </div>
                </div>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td colspan="4">认证信息</td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel">企业实名认证：</td>
            <td>
                <label><input type="radio" class="textbox-prompt" v-model="params.info.audit_company" value="0">未提交</label>
                <label><input type="radio" class="textbox-prompt" v-model="params.info.audit_company" value="1">待审核</label>
                <label><input type="radio" class="textbox-prompt" v-model="params.info.audit_company" value="2">已通过</label>
                <label><input type="radio" class="textbox-prompt" v-model="params.info.audit_company" value="3">未通过</label>
            </td>
            <td class="tlabel">联系人实名认证：</td>
            <td>
                <label><input type="radio" class="textbox-prompt" v-model="params.info.audit_members" value="0">未提交</label>
                <label><input type="radio" class="textbox-prompt" v-model="params.info.audit_members" value="1">待审核</label>
                <label><input type="radio" class="textbox-prompt" v-model="params.info.audit_members" value="2">已通过</label>
                <label><input type="radio" class="textbox-prompt" v-model="params.info.audit_members" value="3">未通过</label>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel">邮箱认证：</td>
            <td>
                <label><input type="radio" class="textbox-prompt" v-model="params.info.audit_email" value="0">未提交</label>
                <label><input type="radio" class="textbox-prompt" v-model="params.info.audit_email" value="1">待审核</label>
                <label><input type="radio" class="textbox-prompt" v-model="params.info.audit_email" value="2">已通过</label>
                <label><input type="radio" class="textbox-prompt" v-model="params.info.audit_email" value="3">未通过</label>
            </td>
            <td class="tlabel">手机认证：</td>
            <td>
                <label><input type="radio" class="textbox-prompt" v-model="params.info.audit_phone" value="0">未提交</label>
                <label><input type="radio" class="textbox-prompt" v-model="params.info.audit_phone" value="1">待审核</label>
                <label><input type="radio" class="textbox-prompt" v-model="params.info.audit_phone" value="2">已通过</label>
                <label><input type="radio" class="textbox-prompt" v-model="params.info.audit_phone" value="3">未通过</label>
            </td>
        </tr>
        <tr>
            <td colspan="6" bgcolor="#F4F4F4" style="border-top:#ddd 1px solid;text-align:right;text-indent: 0; padding-left: 0;">
                <div class="dialog-button">
                    <a href="javascript:;" class="l-btn l-btn-small" @click="submit()"><span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">保存</span><span class="l-btn-icon icon-ok">&nbsp;</span></span></a>
                    <a href="javascript:;" class="l-btn l-btn-small" @click="clear()"><span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">关闭</span><span class="l-btn-icon icon-no">&nbsp;</span></span></a>
                </div>
            </td>
        </tr>
    </table>
    <div style="padding:5px"></div>
</form>

<script>
    var companyeditVm = new Vue({
        el: '#<?php echo $uniqid;?>',
        data: {
            params: JSON.parse('<?php echo addslashes(json_encode($dataset));?>'),
            city: JSON.parse('<?php echo addslashes(json_encode($city));?>'),
            industry: JSON.parse('<?php echo addslashes(json_encode($industry));?>'),
            rank: JSON.parse('<?php echo addslashes(json_encode($rank));?>'),
        },
        methods: {
            init: function () {
            },
            submit: function () {
                companyeditVm.params.status = companyeditVm.params.status ? 1 : 0;
                companyeditVm.params.members.expired_modify = $('#<?php echo $uniqid;?> #expired_modify').val();
                $.post('/admin/company/edit', companyeditVm.params, function (data) {
                    if (data.ret == 0) {
                        $.messager.show({
                            title: '提示',
                            msg: data.msg,
                            timeout: 3000,
                            showType: 'slide'
                        });
                        if(typeof(companyReload)==='function'){
                            companyReload();
                        }
                        companyeditVm.clear();
                    } else {
                        $.messager.alert('提示', data.msg, 'warning');
                    }
                }, 'json');
            },
            clear: function (){
                $('#<?php echo $uniqid;?>').form('clear');
                $('#rightTabs').tabs('close','会员编辑');
            },
            rm(index) {
                $.messager.confirm('确认对话框', '您确认删除么？', function (r) {
                    if (r) {
                        if (index === 1) {
                            companyeditVm.params.logo = '';
                        } else if (index === 2) {
                            companyeditVm.params.info.idcard_img1 = '';
                        } else if (index === 3) {
                            companyeditVm.params.info.idcard_img2 = '';
                        } else if (index === 4) {
                            companyeditVm.params.info.licence_img = '';
                        } else if (index === 5) {
                            companyeditVm.params.info.banner = '';
                        }
                    }
                });
            }
        }
    });
    $(function () {
        companyeditVm.init();
        qiniu_single('companylogoPickfile<?php echo $uniqid;?>', function (res) {
            companyeditVm.params.logo = '';
            companyeditVm.params.logo = res;
        });
        qiniu_single('shenfenzheng1Pickfile<?php echo $uniqid;?>', function (res) {
            companyeditVm.params.members_info.idcard_img1 = '';
            companyeditVm.params.members_info.idcard_img1 = res;
        });
        qiniu_single('shenfenzheng2Pickfile<?php echo $uniqid;?>', function (res) {
            companyeditVm.params.members_info.idcard_img2 = '';
            companyeditVm.params.members_info.idcard_img2 = res;
        });
        qiniu_single('licenceimgPickfile<?php echo $uniqid;?>', function (res) {
            companyeditVm.params.info.licence_img = '';
            companyeditVm.params.info.licence_img = res;
        });
        qiniu_single('companybannerPickfile<?php echo $uniqid;?>', function (res) {
            companyeditVm.params.info.banner = '';
            companyeditVm.params.info.banner = res;
        });
    });
</script>
